package edu.arizona.sista.learn.activity.fluents.paths;

public class Point3D {
	private double x, y, z;
	
	public Point3D() {
		this(0, 0, 0);
	}
	
	public Point3D(double x, double y, double z) {
		setX(x);
		setY(y);
		setZ(z);
	}
	
	public Point3D(String x, String y, String z) {
		this(Double.parseDouble(x), Double.parseDouble(y), Double.parseDouble(z));
	}
	
	public Point3D(Point3D p) {
		this(p.getX(), p.getY(), p.getZ());
	}
	
	@Override
	public String toString() {
		return "<Point3D("+x+", "+y+", "+z+")>";
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getX() {
		return x;
	}

	public void setY(double y) {
		this.y = y;
	}

	public double getY() {
		return y;
	}

	public void setZ(double z) {
		this.z = z;
	}

	public double getZ() {
		return z;
	}
	
	public double distanceTo(Point3D p) {
		return new Vec3D(this, p).magnitude();
	}
}
